<!DOCTYPE html>
<html>
<head>
	<title>写文章</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<#include "../../common/commonCss.html">
	<link rel="stylesheet" href="resources/Front/editor.md-master/css/editormd.css"/>
	<style type="text/css">
		.panel>.list-group .list-group-item.active {
			color: #555;
			font-weight: bold;
			background-color: transparent;
			border-color: #DDDDDD;
		}
		
		.bar {
			background-color: #51D49A;
			position: absolute;
			left: 0;
			top: 0;
			height: 100%;
			width: 5px;
		}
	</style>
</head>
<body>
	<!-- head -->
	<#include "../../common/commonHead.html">
	
	<div id="wrap">
		<!-- 主体 -->
		<div class="container main">

			<!-- 左侧list面板 -->
			<#include "../list.html">

			<div class="col-md-10">
				<div class="panel panel-default">
					<div class="panel-heading" role="tab" id="collapseListGroupHeading1"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> 写新文章
						<button id="save" type="button" class="btn btn-primary" style="float: right;">保存</button></div>
					<div>
						<div class="panel-body">
							<!--编辑器-->
							<div id="test-editormd">
							    <textarea style="display:none;" id="ts"></textarea>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>

	<!-- 底部 --> 
	<#include "../../common/commonFoot.html"> 
	<!-- <div class="weather"><iframe width="250" scrolling="no" height="60" frameborder="0" allowtransparency="true" src="http://i.tianqi.com/index.php?c=code&amp;id=12&amp;icon=1&amp;num=1"></iframe></div> -->
	<#include "../../common/commonJs.html">
	<script type="text/javascript" src="resources/Front/js/blog.js"></script>
	<script type="text/javascript" src="resources/Front/js/markdown/markdown.js"></script>
	<script src="resources/Front/editor.md-master/editormd.js"></script> 
	<script src="resources/Front/editor.md-master/plugins/help-dialog/help-dialog.js"></script> 
	<script type="text/javascript">
		//    调用编辑器
		var testEditor;
		$(function() {
		    testEditor = editormd("test-editormd", {
		        width   : "100%",
		        height  : 640,
		        syncScrolling : "single",
		        path    : "resources/Front/editor.md-master/lib/",
		        //theme : "dark",
                //previewTheme : "dark",
                //editorTheme : "pastel-on-dark",
                codeFold : true,
                //syncScrolling : false,
                saveHTMLToTextarea : true,    // 保存 HTML 到 Textarea
                searchReplace : true,
                //watch : false,                // 关闭实时预览
                htmlDecode : "style,script,iframe|on*",            // 开启 HTML 标签解析，为了安全性，默认不开启    
                //toolbar  : false,             //关闭工具栏
                //previewCodeHighlight : false, // 关闭预览 HTML 的代码块高亮，默认开启
                emoji : true,
                taskList : true,
                tocm            : true,         // Using [TOCM]
                tex : true,                   // 开启科学公式TeX语言支持，默认关闭
                flowChart : true,             // 开启流程图支持，默认关闭
                sequenceDiagram : true,       // 开启时序/序列图支持，默认关闭,
                //dialogLockScreen : false,   // 设置弹出层对话框不锁屏，全局通用，默认为true
                //dialogShowMask : false,     // 设置弹出层对话框显示透明遮罩层，全局通用，默认为true
                //dialogDraggable : false,    // 设置弹出层对话框不可拖动，全局通用，默认为true
                //dialogMaskOpacity : 0.4,    // 设置透明遮罩层的透明度，全局通用，默认值为0.1
                //dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色，全局通用，默认为#fff
                
                /**上传图片相关配置如下*/
                imageUpload : true,
                imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                imageUploadURL : "/blog/markdown/uploadImg",

                /*上传图片成功后可以做一些自己的处理*/
                onload: function () {
                    //console.log('onload', this);
                    //this.fullscreen();
                    //this.unwatch();
                    //this.watch().fullscreen();
                    //this.width("100%");
                    //this.height(480);
                    //this.resize("100%", 640);
                },
		    });
		});
		//testEditor.getHTML();
		//testEditor.getMarkdown();
	</script>
</body>
</html>